package com.ssy.lingxi.product.model.request.material;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;

/**
 * 商品能力 - 物料流程规则配置 新增请求数据
 * @author 彭冬冬
 * @version 2.0.0
 * @date 2022/3/28 14:20
 */
public class MaterialProcessVO implements Serializable {
    private static final long serialVersionUID = -1414728172866148199L;


    /**
     * 流程规则名称
     */
    @NotBlank(message = "请填写流程规则名称")
    @Size(max = 200, message = "流程规则名称最长200个字符")
    private String name;

    /**
     * 基础物料流程id
     */
    @NotNull(message = "请选择流程规则")
    @Positive(message = "请选择流程规则")
    private Long baseProcessId;

    /**
     * 适用物料类型 枚举值
     * 1 - 所有物料
     * 2 - 选择部分物料组
     * 3 - 选择部分物料
     */
    @NotNull(message = "适用物料类型， 枚举值在 1~3")
    @Min(value = 1, message = "适用物料类型， 枚举值在 1~3")
    @Max(value = 3, message = "适用物料类型， 枚举值在 1~3")
    private Integer suitableMaterialType;
    /**
     * 选择部分物料分组
     * 适用物料类型是 2 时，必须选择一个物料分组
     */
    @Valid
    private List<MaterialProcessRelMaterialGroupVO> materialGroups;

    /**
     * 选择部分物料
     * 适用物料类型是 3 时， 必须选择一个物料
     */
    @Valid
    private List<MaterialProcessRelMaterialVO> materials;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getBaseProcessId() {
        return baseProcessId;
    }

    public void setBaseProcessId(Long baseProcessId) {
        this.baseProcessId = baseProcessId;
    }

    public Integer getSuitableMaterialType() {
        return suitableMaterialType;
    }

    public void setSuitableMaterialType(Integer suitableMaterialType) {
        this.suitableMaterialType = suitableMaterialType;
    }

    public List<MaterialProcessRelMaterialGroupVO> getMaterialGroups() {
        return materialGroups;
    }

    public void setMaterialGroups(List<MaterialProcessRelMaterialGroupVO> materialGroups) {
        this.materialGroups = materialGroups;
    }

    public List<MaterialProcessRelMaterialVO> getMaterials() {
        return materials;
    }

    public void setMaterials(List<MaterialProcessRelMaterialVO> materials) {
        this.materials = materials;
    }
}
